package org.jeecg.modules.friends.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created on 2025-02-19
 */
public class StringTool {
    public static boolean containsContactInfo(String text) {
        // 简单识别手机号、微信(vx)、QQ等关键词及数字组合的正则
        String regex =
                "(?i)(?:\\b1[3-9]\\d{9}\\b|vx[:：]?\\s*\\w+|微信[:：]?\\s*\\w+|qq[:：]?\\s*\\d{5,11}|电话[:：]?\\s*\\d{7,11})";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(text);
        return matcher.find();
    }
}
